aboutsummaryrefslogtreecommitdiff
path: root/src/app/(main)/websites/[websiteId]/cohorts/CohortAddButton.tsx
blob: 3f7f872325e67ae88dc64402a2dde752c82063fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { useMessages } from '@/components/hooks';
import { Plus } from '@/components/icons';
import { DialogButton } from '@/components/input/DialogButton';
import { CohortEditForm } from './CohortEditForm';

export function CohortAddButton({ websiteId }: { websiteId: string }) {
  const { formatMessage, labels } = useMessages();

  return (
    <DialogButton
      icon={<Plus />}
      label={formatMessage(labels.cohort)}
      variant="primary"
      width="800px"
    >
      {({ close }) => {
        return <CohortEditForm websiteId={websiteId} onClose={close} />;
      }}
    </DialogButton>
  );
}